import alovaInstance from '@/api/alova.ts';
import type { Config, ModInfoType, Respose, EnchantmentEntity } from '@/api/types.ts';

const map: Map<string, string> = new Map();
const baseURL = '/api';
export default {
  getInfo: () => alovaInstance.Get<Respose<ModInfoType>>(baseURL + '/get/info'),
  getEnchantments: () => alovaInstance.Get<Respose<EnchantmentEntity[]>>(baseURL + '/get/enchantments'),
  getConfig: () => alovaInstance.Get<Respose<Config>>(baseURL + '/get/client/config'),
  getTest: (fid: number, sid: number) =>
    alovaInstance.Post<Respose<boolean>>(baseURL + '/get/test', {
      fid,
      sid,
    }),
  sendConfig: (config: Config) => alovaInstance.Post(baseURL + '/send/config', config),
};
